package net.zoneland.zrdp.biz.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.zoneland.zrdp.common.enums.BaseEnum;

/**
 * 1、待办 2、已办 3、待阅 4、已阅对应的头部按钮.
 * @version v1.0
 * @author Pbody
 * 创建日期： 2020/9/15 10:43
 */
@Getter
@AllArgsConstructor
public enum AcmsStateEnum implements BaseEnum<Integer> {

    TASK(1, "待办"),
    DONE(2, "已办"),
    READ(3, "待阅"),
    READ_DONE(4, "已阅");

    /** 枚举值. **/
    @JsonValue
    private final Integer value;
    /** 枚举名称. **/
    private final String name;

    public static AcmsStateEnum fromValue(Integer value) {
        for (AcmsStateEnum state : AcmsStateEnum.values()) {
            if (state.getValue().equals(value)) {
                return state;
            }
        }
        throw new IllegalArgumentException("No enum constant for value: " + value);
    }
}
